package fr.umlv.ig.extraWindows;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JDialog;
import javax.swing.JFrame;

/**
 * Extends {@link JDialog}.
 * Creates a new {@link JDialog} with more informations.
 */

@SuppressWarnings("serial")
public abstract class ExtraWindow extends JDialog {
	
	
	/**
	 * Calls the constructor of the super type and creates a window.
	 * The window can not to be reduce.
	 * His location is relative to parent and the default close operation is DO_NOTHING_ON_CLOSE.
	 * @param owner owner's window
	 * @param title title of the ExtraWindow
	 * @param modal the modality
	 * @param width width of the ExtraWindow
	 * @param height height of the ExtraWindow
	 */
	ExtraWindow(JFrame owner, String title, boolean modal, int width, int height){
		super(owner, title, modal);
		setResizable(false);
		setSize(width, height);
		setLocationRelativeTo(owner);
	}
	
	
	/**
	 * This method is call to show all components of the window.
	 */
	public abstract void start();
	
	ActionListener dialogListner = new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent arg0) {
			dispose();	
		}
	};
	


}
